#include "input.h"

void get_input() {
    SDL_Event event;

    while (SDL_PollEvent(&event)) {
        switch (event.type) {
            case SDL_QUIT:
                exit(0);
            break;

            case SDL_KEYDOWN:
                switch (event.key.keysym.sym) {
                    case SDLK_ESCAPE:
                        if (event.key.keysym.mod & KMOD_CTRL)
                            exit(0);
                    break;
                    case SDLK_q:
                        if (event.key.keysym.mod & KMOD_CTRL)
                            exit(0);
                    break;
                    case SDLK_w:
                        set_cynth_sprite(CYN01);
                    break;
                    case SDLK_a:
                        set_cynth_sprite(CYN02);
                    break;
                    case SDLK_s:
                        set_cynth_sprite(CYN03);
                    break;
                    case SDLK_d:
                        set_cynth_sprite(CYN02);
                    break;
                        
                    default: break;
                }
            break;

            default: break;
        }
    }
}
